package test;


import java.awt.Component;
import java.sql.SQLException;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

class PolicyWindow extends JFrame {
    public PolicyWindow() throws SQLException {
        this.setTitle("政策信息");
        this.setSize(600, 400);
        this.setDefaultCloseOperation(2);
        this.setLocationRelativeTo((Component)null);
        JTabbedPane tabbedPane = new JTabbedPane();
        PolicyService policyService = new PolicyService();
        List<JPanel> policyPanels = policyService.createPolicyPanels();

        for(int i = 0; i < policyPanels.size(); ++i) {
            tabbedPane.addTab("政策 " + (i + 1), (Component)policyPanels.get(i));
        }

        this.add(tabbedPane, "Center");
    }
}
